package com.way;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * @author 魏彪
 */
@SpringBootApplication
public class Test05 {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Test05.class, args);
        ThreadPoolTaskExecutor executor = context.getBean(ThreadPoolTaskExecutor.class);
        executor.execute(() -> System.out.println("String中提供的异步执行"));
        executor.submit(() -> System.out.println("异步线程执行2.。。"));
        System.out.println("主线程执行结束");
    }
}
